package com.fivemin.model.baseEntity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fivemin.enums.EnumStatus;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * ClassName: BaseEntiry
 * Description:
 * date: 2023/7/27 14:22
 *
 * @author li
 * @since JDK 1.8
 */
public class BaseEntity {
    /**
     * 唯一ID
     */
    private String uid;

    /**
     * 状态 0：失效  1：生效
     */
    private int status;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    public BaseEntity() {
        this.status = EnumStatus.ENABLE;
        this.createTime = new Date();
        this.updateTime = new Date();
    }
}
